﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FriendLink_Add.aspx.cs" Inherits="Admin_FriendLink_Add" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>添加友情链接-河北大学管理学院信息管理系</title>
    <meta name="Keywords" content="河北大学管理学院信息管理系" />
    <meta name="Description" content="河北大学管理学院信息管理系官方网站" />
    <meta name="Author" content="朱胜贤、孙旭峰、水亚亚、张文元、项玥、吕芳、吴凡、谢静、李亚慧" />
    <meta name="Copyright" content="本系统版权归 河北大学信管团队 所有。All Rights Reserved" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../CSS/AD_Pub.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
    <%--<script type="text/javascript">
        function clearfile(file, img, width, height) {
            document.getElementById(file).parentNode.style.display = "";
            document.getElementById(file).parentNode.innerHTML = '<input type="file" name="' + file + '" id="' + file + '" onchange="showimg(\'' + file + '\',\'' + img + '\')" size="7" class="input" />';
            document.getElementById(img).innerHTML = "<img style='width:" + width + "px;height:" + height + "px' src='' />";
        }
        function showimg(file, img, width, height) {
            var dFile = document.getElementById(file);
            var dImg = document.getElementById(img);
            if (!getPath(dFile).match(/.jpg|.gif|.png|.bmp/i)) {
                alert('上传图片格式必须是以下几种之一： .jpg , .gif , .bmp  或 .png !');
                clearfile(file, img);
                return;
            }
            if (dFile.files) {
                dImg.innerHTML = "<img src='" + dFile.files[0].getAsDataURL() + "' style='width:" + width + "px;height:" + height + "px'/>";
            }
            else {
                if (dFile.value.indexOf('\\') > -1 || dFile.value.indexOf('\/') > -1) {
                    dImg.innerHTML = "";
                    dImg.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = getPath(dFile);
                }
            }
        }
        function getPath(obj) {
            if (obj) {
                if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
                    obj.select();
                    return document.selection.createRange().text;
                }
                else if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
                    if (obj.files) {
                        return obj.files.item(0).getAsDataURL();
                    }
                    return obj.value;
                }
                return obj.value;
            }
        }


    </script>--%>
</head>
<body>
    <form id="form1" runat="server">
    <div id="Container">
        <div id="Header">
            <asp:Label ID="lblTitle" runat="server" Text=""></asp:Label></div>
        <div id="PageBody">
            <div class="line1">
                <div class="lineLeft">
                    友情链接名称：</div>
                <div class="lineRight">
                    <asp:TextBox ID="friName" runat="server" Width="350px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="friName"
                        ErrorMessage="标题不能为空" ForeColor="Red"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="line2">
                <div class="lineLeft">
                    链接地址：</div>
                <div class="lineRight">
                    <asp:TextBox ID="friAddress" runat="server" Width="400px">http://</asp:TextBox>
                    <asp:RegularExpressionValidator ID="rev" runat="server" 
                        ErrorMessage="地址格式错误！" ForeColor="Red" 
                        ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?" 
                        ControlToValidate="friAddress"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="rfvUrl" runat="server" 
                        ErrorMessage="地址不能为空！" ForeColor="Red" ControlToValidate="friAddress" ></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="line5">
                <div class="lineLeft">
                    链接的Logo：</div>
                <div class="lineRight">
                    <asp:Image ID="fulImg" runat="server" Height="100px" /><br />
                    <asp:FileUpload ID="fup" runat="server" />
                    <asp:Literal ID="Literal1" runat="server" ></asp:Literal>
                   
                    <asp:Label ID="lblDownUrl" runat="server" ForeColor="red"></asp:Label>
                    <asp:Label ID="lblFileUrl" runat="server" Visible="False"></asp:Label>
                    <%--<asp:Button ID="bntPreview" runat="server" Text="预览图片" onclick="bntPreview_Click" />--%>
                </div>
            </div>
            <div class="line2">
                <div class="lineLeft">
                    网站简介：</div>
                <div class="lineRight">
                    <asp:TextBox ID="friInfo" runat="server" Width="600px"></asp:TextBox>
                </div>
            </div>
            <div class="line1">
                <div class="lineLeft">
                    排序号：      </div>  
                 <div class="lineRight">
                    <asp:TextBox ID="friNum" runat="server">0</asp:TextBox><span class="f1">（说明：请输入0-255的整数，数越大排列越靠前）<asp:RequiredFieldValidator
                        ID="rfvNum" runat="server" ControlToValidate="friNum" Display="Dynamic" ErrorMessage="顺序不能为空"></asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="rvdNum" runat="server" ControlToValidate="friNum" Display="Dynamic"
                            ErrorMessage="顺序号输入错误" MaximumValue="255" MinimumValue="0" Type="Integer"></asp:RangeValidator></span></div>
            </div>
            <div class="line2">
                <div class="lineLeft">
                    显示设置：
                </div>
                <div class="lineRight">
                    <asp:CheckBox ID="ckbIsShow" runat="server" Checked="True" Text="显示" />
                </div>
             </div>
            <div id="bottom">
                <asp:Button ID="btnOK" CssClass="btn" runat="server" Text="确 定" OnClick="btnOK_Click" />
                &nbsp;
                <asp:Button ID="btnCancel" CssClass="btn" runat="server" Text="取 消" CausesValidation="False"
                    OnClick="btnCancel_Click" />
            </div>
        </div>
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label><asp:Label
            ID="lblID" runat="server" Visible="False"></asp:Label>
    </div>
    </form>
</body>
</html>
